home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / DataScope 2.0.3 / Datafiles / externs / Mac_externs / rowarray.c < prev   
Encoding:
C/C++ Source or Header  |  1994-05-04  |  672 b   |  34 lines  |  [TEXT/MPS ]

  1. #include "DScope.h"
  2. /*
  3.     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4.     rowarray    Fill the result array with
  5.                 copies of the y scale values,
  6.                 one for each row.  This will
  7.                 be used in calculations which
  8.                 are applied to the whole
  9.                 array, but depend on the
  10.                 values of the y scale.  In
  11.                 other words, at every point
  12.                 in the array, we have its
  13.                 corresponding column scale
  14.                 value.
  15.     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  16. */
  17. long addon(l,r,a)
  18.     scope_array        *l,*r,*a;
  19. {
  20.     register float    *f,*fy;
  21.     register int    i,j;
  22.  
  23.     fy = a->rows;
  24.     f = a->vals;
  25.     
  26.     for (i=0; i< a->nrows; i++) {
  27.         for (j=0; j< a->ncols; j++)
  28.             *f++ = *fy;
  29.         fy++;
  30.     }
  31.     return (0);    
  32. }
  33.  
  34.